# @Time : 2024-10-24 11:10
# @Author : Fioman 
# @Phone : 13149920693
class MyClass(object):
    Name = "3"
    Age = 18

    def __init__(self):
        self.name = "Fioman"


instance = MyClass()
print(instance.Name)  # 先查找实例属性
print(instance.Age)  # 如果实例属性没有,会继续向上查找类属性
print(MyClass.__mro__)  # 查看他的属性查找顺序表


# region  1. 深度优先查找  (从最左侧继承类开始,这个类从上到下,查到最顶层,然后查右边的,也是从上到下)
class A:
    pass


class B:
    pass


class C(A):
    pass


class D(B):
    pass


class E(C, D):
    pass


print(E.__mro__)  # 深度优先


# endregion

class F:
    pass


class G(F):
    pass


class H(F):
    pass


class I(G, H):
    pass


print(I.__mro__)  # 深度优先

"""
至于是深度优先还是广度优先,取决于它的继承查找算法,叫C3算法
"""
